package com.zhouxiaoge.security.validate.code;

import java.time.LocalDateTime;

/**
 * 作者： 周小哥
 * 时间： 2018-07-25 22:41
 * 邮箱： gqzmy@outlook.com
 */

public class ValidateCode {


    private String code;

    private LocalDateTime expireTime;

    public ValidateCode() {
    }

    public boolean isExpried() {
        return LocalDateTime.now().isAfter(expireTime);
    }

    public ValidateCode(String code, int expireInt) {
        this.code = code;
        this.expireTime = LocalDateTime.now().plusSeconds(expireInt);
    }

    public ValidateCode(String code, LocalDateTime expireTime) {
        this.code = code;
        this.expireTime = expireTime;
    }


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public LocalDateTime getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(LocalDateTime expireTime) {
        this.expireTime = expireTime;
    }
}
